
export default {
  namespaced: true,
  state: {
   count:0,
    sysCode: { aaa: "111", bbb: "222" }
  },
 
  mutations: { //同步方法代替构造器
    setSysUser(state, user) {
      state.sysUser = user;
    },
    setSysCode(state, code) {
      state.sysCode = code;
    },
    setAdd(state,code){
      state.count+=code;
    }
  },
 
  actions: { //异步方法->外部使用的方法
    userLoad(context, code) {
      context.commit("setSysUser", code);//间接调用mutations
    },
    codeLoad({ commit }, code) {
      commit("setSysCode", code);
    }
  }
};